using UnityEngine;
using System.Collections;

public class levelStorage : MonoBehaviour 
{
    public bool[] levelsCompletedSolarSystemOne;
    public string[] sceneNamesPerLevelSolarSystemOne;
    public string[] levelNameSolarSystemOne;
	public GameObject Storage;
    // Use this for initialization
	void Start () 
	{
		Storage = GameObject.FindWithTag("storage");
        DontDestroyOnLoad(this);
		
		for(int q = 1; q<levelsCompletedSolarSystemOne.Length; q++)
		{
			if(Storage.GetComponent<storage>().systemOne[q]=="true")
				levelsCompletedSolarSystemOne[q] = true;
		}

	}
	public void kill()
	{
		for(int q = 1; q<levelsCompletedSolarSystemOne.Length; q++)
		{
			if(levelsCompletedSolarSystemOne[q] == true)
				Storage.GetComponent<storage>().systemOne[q] = "true";
		}
		save();
		Destroy(gameObject);
	}
	public void save()
	{
		Storage.GetComponent<storage>().save();
	}
}
